﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Logic;
using Entities;

namespace Presentation
{
	public partial class InfoTags : UserControl
	{
		public InfoTags()
		{
			InitializeComponent();
		}

		public void Initialize(Movie entity)
		{
			Tag = entity;

			List<TagControl> collection = new List<TagControl>();

			foreach (Tag tag in entity.Tags)
			{
				TagControl tagControl = new TagControl(tag.Name);
				tagControl.Tag = tag;

				collection.Add(tagControl);
			}

			tagBoxTags.SetObjects(collection);
		}

		public List<Tag> GetTags()
		{
			List<Tag> tags = new List<Tag>();

			foreach (TagControl tagcontrol in tagBoxTags.Tags)
			{
				tags.Add((Tag)(tagcontrol.Tag));
			}

			return tags;
		}
	}
}
